package com.example.web.controller;

import com.example.db1.service.IOrderService;
import com.example.db2.service.IAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
public class MainController {

    @Autowired
    private IOrderService orderService;

    @Autowired
    private IAccountService accountService;

    @GetMapping("/order")
    public Object getUsers() {
        return orderService.getOrderList();
    }

    @GetMapping("/account")
    public Object getProducts() {
        return accountService.getAccountList();
    }
}